<?php 
/**
 * Parameters
 * @param 	string		$class 				Class for div box
 * @param	array		$work_items			Array with work items
 * @param	integer		$num_spare_items	Number of unread work items that are not shown
 */
  use_helper('Date');
?>
<?php if(!isset($class)) $class = '';?>
		<div class="<?php echo $class; ?>">
			<h2 class="box">Nachrichten<img alt="Geburtstage" src="<?php echo image_path('icons/content_geburtstag.png')?>" /></h2>
			<table class="box_table">
				<colgroup>
					<col width="70%"></col>
					<col width="30%"></col>
				</colgroup>
				<tbody>
				<?php if(count($work_items) > 0):?>
				<?php foreach($work_items as $i => $work_item):?>
					<tr<?php if(($i%2) != 0):?> class="zebra"<?php endif;?>>
						<td><a href="<?php echo url_for('wf_workflow_inbox_message_show', $work_item->getObject());?>"><?php echo $work_item->getSubject()?></a></td>
						<td><?php echo format_date($work_item->getObject()->getCreatedAt(), 'd. MMMM, H:mm')//->format('d.m.Y')?> Uhr</td>
					</tr>
				<?php endforeach;?>
					<tr<?php if(($i%2) == 0):?> class="zebra"<?php endif;?>>
						<td colspan="2"><a href="<?php echo url_for('wf_workflow_inbox');?>">... und <?php echo ($num_spare_items == 1 ? 'eine' : ($num_spare_items > 1 ? $num_spare_items : 'keine'))?> weitere ungelesene Nachrichten.</a></td>
					</tr>
				<?php else:?>
					<tr>
						<td colspan="2">keine ungelesenen Nachrichten.</td>
					</tr>
				<?php endif;?>
				</tbody>
			</table>
		</div>